#!/bin/sh -xe

if [ -d "p2024-dr-edge" ]; then
    # delete
    rm -rf p2024-dr-edge
fi

# clone
git clone https://gitee.com/aprogrotess/p2024-dr-edge.git

# cd and cache clean
cd p2024-dr-edge/DrUI

if [ ! -d "DrUI/build" ]; then
    # clone 
    rm -rf QmlClient/build
fi

if [ ! -d "DrUI/dist" ]; then
    # clone 
    rm -rf QmlClient/dist
fi

# docker run
docker run \
     --rm \
     -v $(pwd)/QmlClient:/workspace/QmlClient \
     -it qt6-gcc-20:v0.01

chmod 777 -R $(pwd)/QmlClient/deploy/dist